import { Rule } from "./types";

export const GemspecRules: Rule[] = [
    {
        id: "Gemspec/DependencyVersion",
        enabled: false,
        descEn: "Requires or forbids specifying gem dependency versions.",
        descCn: "",
        versionAdded: "1.29",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "required",
                optionList: ["required", "forbidden"],
            },
            {
                param: "Include",
                defaultValue: ["**/*.gemspec"],
            },
            {
                param: "AllowedGems",
                defaultValue: [],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_gemspec.html#gemspecdependencyversion",
    },
    {
        id: "Gemspec/DeprecatedAttributeAssignment",
        enabled: "pending",
        descEn: "Checks that deprecated attribute assignments are not set in a gemspec file.",
        descCn: "",
        versionAdded: "1.30",
        versionChanged: "1.40",
        paramList: [
            {
                param: "Severity",
                defaultValue: "warning",
                optionList: ["info", "refactor", "convention", "warning", "error", "fatal"],
            },
            {
                param: "Include",
                defaultValue: ["**/*.gemspec"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_gemspec.html#gemspecdeprecatedattributeassignment",
    },
    {
        id: "Gemspec/DevelopmentDependencies",
        enabled: "pending",
        descEn: "Checks that development dependencies are specified in Gemfile rather than gemspec.",
        descCn: "",
        versionAdded: "1.44",
        paramList: [
            {
                param: "EnforcedStyle",
                defaultValue: "Gemfile",
                optionList: ["Gemfile", "gems.rb", "gemspec"],
            },
            {
                param: "AllowedGems",
                defaultValue: [],
            },
            {
                param: "Include",
                defaultValue: ["**/*.gemspec", "**/Gemfile", "**/gems.rb"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_gemspec.html#gemspecdevelopmentdependencies",
    },
    {
        id: "Gemspec/DuplicatedAssignment",
        enabled: true,
        descEn: "An attribute assignment method calls should be listed only once in a gemspec.",
        descCn: "",
        versionAdded: "0.52",
        versionChanged: "1.40",
        paramList: [
            {
                param: "Severity",
                defaultValue: "warning",
                optionList: ["info", "refactor", "convention", "warning", "error", "fatal"],
            },
            {
                param: "Include",
                defaultValue: ["**/*.gemspec"],
            },
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_gemspec.html#gemspecduplicatedassignment",
    },
    {
        id: "Gemspec/OrderedDependencies",
        enabled: true,
        descEn: "Dependencies in the gemspec should be alphabetically sorted.",
        descCn: "",
        versionAdded: "0.51",
        paramList: [
            {
                param: "TreatCommentsAsGroupSeparators",
                defaultValue: true,
            },
            {
                param: "ConsiderPunctuation",
                defaultValue: false,
            },
            {
                param: "Include",
                defaultValue: ["**/*.gemspec"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_gemspec.html#gemspecordereddependencies",
    },
    {
        id: "Gemspec/RequireMFA",
        enabled: "pending",
        descEn: "Checks that the gemspec has metadata to require Multi-Factor Authentication from RubyGems.",
        descCn: "",
        versionAdded: "1.23",
        versionChanged: "1.40",
        paramList: [
            {
                param: "Severity",
                defaultValue: "warning",
                optionList: ["info", "refactor", "convention", "warning", "error", "fatal"],
            },
            {
                param: "Include",
                defaultValue: ["**/*.gemspec"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_gemspec.html#gemspecrequiremfa",
    },
    {
        id: "Gemspec/RequiredRubyVersion",
        enabled: true,
        descEn: "Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml",
        descCn: "",
        versionAdded: "0.52",
        versionChanged: "1.40",
        paramList: [
            {
                param: "Severity",
                defaultValue: "warning",
                optionList: ["info", "refactor", "convention", "warning", "error", "fatal"],
            },
            {
                param: "Include",
                defaultValue: ["**/*.gemspec"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_gemspec.html#gemspecrequiredrubyversion",
    },
    {
        id: "Gemspec/RubyVersionGlobalsUsage",
        enabled: true,
        descEn: "Checks usage of RUBY_VERSION in gemspec.",
        descCn: "",
        versionAdded: "0.72",
        versionChanged: "1.40",
        paramList: [
            {
                param: "Severity",
                defaultValue: "warning",
                optionList: ["info", "refactor", "convention", "warning", "error", "fatal"],
            },
            {
                param: "Include",
                defaultValue: ["**/*.gemspec"],
            }
        ],
        url: "https://docs.rubocop.org/rubocop/1.50/cops_gemspec.html#gemspecrubyversionglobalsusage",
    },
];